/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo1012;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author Administrator
 */
public class FileReaderDemo {

    public static void main(String args[]) {
        try {
            FileReader fr = new FileReader("e:/data.txt");
            int x = 0;
          //  x = fr.read();
          //  System.out.println(Integer.toHexString(x));
//      
//        x= fr.read();
//      System.out.println((char)x);
//       x= fr.read();
//      System.out.println((char)x);
            while ((x = fr.read()) != -1) {
                System.out.println((char) x);
            }

        } catch (FileNotFoundException e) {
            System.out.println("file not found");


        } catch (IOException e) {
             System.out.println("io error");
        }

    }
}
